package com.fxm.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * @author fxm
 * @version V1.0.0
 * @description: 答题情况
 * @date 2020/12/29 18:30
 */
public enum AnswerEnum {

    RIGHT(0, "正确"),
    WRONG(1, "错误");

    private Integer code;
    private String desc;

    AnswerEnum (Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static AnswerEnum getInstance(Integer code) {
        for (AnswerEnum item : AnswerEnum.values()) {
            if (item.code.equals(code)) {
                return item;
            }
        }
        return null;
    }

}
